import { GaRegExp, ruleInject, ruleInjectable } from "../InjectionRule";
import { blankRemove } from "../methods/blank-remove";
import { MakeListRule } from "../methods/make-list";

@ruleInjectable()
export default class typeNameRule extends GaRegExp {

	@ruleInject() private variableNameRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			this.Supply("TYPE_NAME"),
			"(", this.variableNameRule, ")", blankRemove,
			"(&", "\\<", ...MakeListRule([this]), "\\>", ")?",
		]);
	}

}
